const {
  override,
  fixBabelImports,
  addLessLoader,
  addWebpackAlias,
  addBabelPlugins
} = require('customize-cra')
const path = require('path')

module.exports = override(
  addBabelPlugins(//支持装饰器
    [
      '@babel/plugin-proposal-decorators',
      { legacy: true }
    ]
  ),
  addWebpackAlias({
    '@': path.resolve(__dirname, 'src'),
  }),
  fixBabelImports('import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    style: true, //'css'
  }),
  //修改主题
  addLessLoader({
    javascriptEnabled: true,
    modifyVars: { '@primary-color': '#1DA57A' },
  })
)
